; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=x86_64-unknown-unknown --show-mc-encoding -mattr=+avxneconvert,+avx512bf16,+avx512vl | FileCheck %s --check-prefix=AVX512BF16-COMMON
; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=i686-unknown-unknown --show-mc-encoding -mattr=+avxneconvert,+avx512bf16,+avx512vl | FileCheck %s --check-prefix=AVX512BF16-COMMON
; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=x86_64-unknown-unknown --show-mc-encoding -mattr=+avx512bf16,+avx512vl | FileCheck %s --check-prefix=AVX512BF16
; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=i686-unknown-unknown --show-mc-encoding -mattr=+avx512bf16,+avx512vl | FileCheck %s --check-prefix=AVX512BF16

define <8 x bfloat> @test_int_x86_vcvtneps2bf16128(<4 x float> %A) {
; AVX512BF16-COMMON-LABEL: test_int_x86_vcvtneps2bf16128:
; AVX512BF16-COMMON:       # %bb.0:
; AVX512BF16-COMMON-NEXT:    {vex} vcvtneps2bf16 %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x7a,0x72,0xc0]
; AVX512BF16-COMMON-NEXT:    # kill: def $xmm1 killed $xmm0
; AVX512BF16-COMMON-NEXT:    ret{{[l|q]}} # encoding: [0xc3]
;
; AVX512BF16-LABEL: test_int_x86_vcvtneps2bf16128:
; AVX512BF16:       # %bb.0:
; AVX512BF16-NEXT:    vcvtneps2bf16 %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7e,0x08,0x72,0xc0]
; AVX512BF16-NEXT:    ret{{[l|q]}} # encoding: [0xc3]
  %ret = call <8 x bfloat> @llvm.x86.vcvtneps2bf16128(<4 x float> %A)
  ret <8 x bfloat> %ret
}
declare <8 x bfloat> @llvm.x86.vcvtneps2bf16128(<4 x float> %A)

define <8 x bfloat> @test_int_x86_vcvtneps2bf16256(<8 x float> %A) {
; AVX512BF16-COMMON-LABEL: test_int_x86_vcvtneps2bf16256:
; AVX512BF16-COMMON:       # %bb.0:
; AVX512BF16-COMMON-NEXT:    {vex} vcvtneps2bf16 %ymm0, %xmm0 # encoding: [0xc4,0xe2,0x7e,0x72,0xc0]
; AVX512BF16-COMMON-NEXT:    # kill: def $xmm1 killed $xmm0
; AVX512BF16-COMMON-NEXT:    vzeroupper # encoding: [0xc5,0xf8,0x77]
; AVX512BF16-COMMON-NEXT:    ret{{[l|q]}} # encoding: [0xc3]
;
; AVX512BF16-LABEL: test_int_x86_vcvtneps2bf16256:
; AVX512BF16:       # %bb.0:
; AVX512BF16-NEXT:    vcvtneps2bf16 %ymm0, %xmm0 # encoding: [0x62,0xf2,0x7e,0x28,0x72,0xc0]
; AVX512BF16-NEXT:    vzeroupper # encoding: [0xc5,0xf8,0x77]
; AVX512BF16-NEXT:    ret{{[l|q]}} # encoding: [0xc3]
  %ret = call <8 x bfloat> @llvm.x86.vcvtneps2bf16256(<8 x float> %A)
  ret <8 x bfloat> %ret
}
declare <8 x bfloat> @llvm.x86.vcvtneps2bf16256(<8 x float> %A)

